
<html>
<head>
    <meta charset="UTF-8">
    <title>考核查看</title>
    <link rel="stylesheet" type="text/css" href="/META-INF/resources/static/devtools30/js/bootstrap-3.3.5/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/META-INF/resources/static/devtools30/js/jquery-easyui-1.5/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/META-INF/resources/static/devtools30/js/jquery-easyui-1.5/themes/icon.css">
    <link rel="stylesheet" href="/META-INF/resources/static/devtools30/js/plugins/validationEngine/css/validationEngine.jquery.css" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="/META-INF/resources/static/devtools30/css/styledevtools.css">
    <link rel="stylesheet" href="/META-INF/resources/static/devtools30/js/plugins/layer/skin/layer.css" />
    <link rel="stylesheet" type="text/css" href="/static/portalres/jsfolder/htmlxjs/skins/dhtmlxgrid.css"/>
    <link rel="stylesheet" type="text/css" href="/static/portalres/jsfolder/htmlxjs/skins/dhtmlxgrid_pgn_bricks.css"/>

    <script type="text/javascript" src="/static/portalres/jsfolder/htmlxjs/dhtmlxcommon.js"></script>
    <script type="text/javascript" src="/static/portalres/jsfolder/htmlxjs/dhtmlxcontainer.js"></script>
    <script type="text/javascript" src="/static/portalres/jsfolder/htmlxjs/dhtmlxgrid.js"></script>
    <script type="text/javascript" src="/static/portalres/jsfolder/htmlxjs/dhtmlxgridcell.js"></script>
    <script type="text/javascript" src="/static/portalres/jsfolder/htmlxjs/dhtmlxgrid_filter.js"></script>
    <script type="text/javascript" src="/static/portalres/jsfolder/htmlxjs/dhtmlxgrid_pgn.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/bootstrap-3.3.5/bootstrap.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/jquery-easyui-1.5/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/jquery-easyui-1.5/datagrid-filter.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/jquery-easyui-1.5/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/my97DatePicker/WdatePicker.js" ></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/easyuiPager.js?=5"></script>

    <script src="/META-INF/resources/static/devtools30/js/plugins/validationEngine/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
    <script src="/META-INF/resources/static/devtools30/js/plugins/validationEngine/languages/jquery.validationEngine-zh_CN.js" type="text/javascript" charset="utf-8">
    </script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/ajaxfileupload.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/datagrid-dnd.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/FormValidation.js"></script>

    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/commondevtools.js"></script>

    <style>
        /*去掉滚动条*/
        /*body{overflow-y:hidden;}*/
    </style>

    <script src='/static/portalres/jsfolder/htmlxjs/dhtmlxgrid_export.js'></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/md5-min.js"></script>

    <!--<script type="text/javascript" src="/static/js/dlcommon.js" ></script>-->
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/jquery.cookie.js"></script>
    <script type="text/javascript" src="/META-INF/resources/static/devtools30/js/usetools/dldevusetool.js"></script>


    <script type="text/javascript">
        //		点取消关闭窗口
        function clearall(){
            var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
            parent.layer.close(index); //执行关闭
        }
        function btnclose(){
            closeIndexWindwos();
        }

    </script>


    <script>

        var height = findDimensions_height();
        var width = findDimensions_width();

        $(function () {

            $('#inputdivhand').datagrid({
                width: '720',
                height: 'auto',
                nowrap: false,
                striped: true,
                border: true,
                collapsible: false,
                singleSelect: true,
                pagination: false,
                rownumbers: true,
                columns: [
                    [
                        { title: '考核指标', colspan: 5 },
                        { title: '分数', colspan: 2 }
                    ], [
                        { field: 'YJName', title: '项目', width: 30, halign: 'center', align: 'left' },
                        { field: 'EJName', title: '细项', width: 70, halign: 'center', align: 'left' },
                        { field: 'SJName', title: '考核内容', width: 280, halign: 'center', align: 'left' },
                        { field: 'BZZ', title: '标准值', width: 70, halign: 'center', align: 'left' },
                        { field: 'SJZ', title: '实际值', width: 70, halign: 'center', align: 'left' },
                        { field: 'KF', title: '扣分', width: 80, align: 'center',
                            formatter: function (value, row, index) {
                                if (row.IsJCZB != 1) {
                                    var val = value == null ? 0 : value
                                    return "<input id='TXT_KF_" + row.ZBID + "' type='text' style='width: 90%' value='" + val + "' class='easyui-numberbox' />";
                                }
                            }
                        },
                        { field: 'JF', title: '加分', width: 80, align: 'right', halign: 'center',
                            formatter: function (value, row, index) {
                                if (row.IsJCZB != 1) {
                                    var val = value == null ? 0 : value
                                    return "<input id='TXT_JF_" + row.ZBID + "' type='text' style='width: 90%' value='" + val + "' class='easyui-numberbox' />";
                                }
                            }
                        }
                    ]],
                onLoadSuccess: function (data) {
                    var jf = 0;
                    var kf = 0;
                    for (var i = 0; i < data.rows.length; i++) {
                        if (data.rows[i].JF != "" || data.rows[i].KF != "") {
                            jf = jf + parseFloat((data.rows[i].JF == "" || data.rows[i].JF == null) ? 0 : data.rows[i].JF);
                            kf = kf + parseFloat((data.rows[i].KF == "" || data.rows[i].KF == null) ? 0 : data.rows[i].KF);
                        }
                    }
                    $("#ZJF").numberbox("setValue", jf == 0 ? "" : jf);
                    $("#ZKF").numberbox("setValue", kf == 0 ? "" : kf);
                    $("div .datagrid-cell .easyui-numberbox").numberbox({
                        precision: 2,
                        onChange: function (newValue, oldValue) {
                            FZOnChange(this, newValue, oldValue);
                        }
                    });
                    $("div .datagrid-cell .easyui-linkbutton").linkbutton({ plain: true });
                }
            });

            $.ajax({
                type: 'get',
                url: 'kaohe.json?rdm=' + parseInt(Math.random() * 100000),
                headers: {'dtuser' :$.cookie('dtuser')},
                xhrFields: {
                    withCredentials: true
                },
                async: false,
                crossDomain: true,
                success: function (dataremot) {
                    var griddata = {};
                    griddata.total = dataremot.total;
                    griddata.rows = dataremot.rows;
                    $('#inputdivhand').datagrid("loadData", griddata);
                    $.each(dataremot.mergeCellsInfo, function (i, n) {
                        $('#inputdivhand').datagrid("mergeCells", n);
                    });
                    $('#inputdivhand').datagrid("fixRowHeight");
                }
            });
            // $('#inputdivhand').datagrid('toExcel', '/ExportController/excel', 'color');
            // $('#inputdivhand').datagrid('toExcel', '/ExportController/excel', 'color');
        });


        function FZOnChange(obj, newValue, oldValue) {
            if (newValue == "")
                return;
            var _ZKF = $("#ZKF").numberbox("getValue");
            var _ZJF = $("#ZJF").numberbox("getValue");
            var FieldName = $(obj).parent().parent().attr("field");
            var rowIndex = $(obj).parent().parent().parent().attr("datagrid-row-index");
            var rowData = $('#KHContext').datagrid("getData").rows[rowIndex];
            var qFieldName = (FieldName == "KF" ? "JF" : "KF");
            var qFieldItem = '#TXT_' + qFieldName + '_' + rowData.ZBID;
            var qFieldValue = $(qFieldItem).numberbox("getValue");
            if ($(qFieldItem).numberbox("getValue") != "")
                $(qFieldItem).numberbox("clear");
            if (FieldName == "KF") {
                $("#ZKF").numberbox("setValue", parseFloat(_ZKF == "" ? "0" : _ZKF) - parseFloat(oldValue == "" ? "0" : oldValue) + parseFloat(newValue == "" ? "0" : newValue));
                $("#ZJF").numberbox("setValue", parseFloat(_ZJF == "" ? "0" : _ZJF) - parseFloat(qFieldValue == "" ? "0" : qFieldValue));
            } else {
                $("#ZKF").numberbox("setValue", parseFloat(_ZKF == "" ? "0" : _ZKF) - parseFloat(qFieldValue == "" ? "0" : qFieldValue));
                $("#ZJF").numberbox("setValue", parseFloat(_ZJF == "" ? "0" : _ZJF) - parseFloat(oldValue == "" ? "0" : oldValue) + parseFloat(newValue == "" ? "0" : newValue));
            }
        }

        function exportData(){
            var opts = $('#inputdivhand').datagrid('getColumnFields', true);
            for(var i=0;i<opts.length;i++){
                var col = $('#inputdivhand').datagrid('getColumnOption', opts[i]);
            }
            $('#inputdivhand').datagrid('options').columns
        }

        function exportData() {
            // $('#inputdivhand').datagrid('toExcelV1', '/toExcelV1.xls');

            // var param={title:'title'};
            // param.filename='toExcelV2.xls'
            // $('#inputdivhand').datagrid('toExcelV2',param);

            var datagridAry=[{id:'inputdivhand',name:'inputdivhand1'},{id:'inputdivhand',name:'inputdivhand2'}];
            dLongDtool.exportExcelEasyuiGrids("exportExcelEasyuiGrids.xls",datagridAry);

            // $('#inputdivhand').datagrid('toExcel', '/ExportController/excel?title=toExcel', 'color');
        }

    </script>
</head>
<body>

<form id="kaoheform">
    <!--<div style="margin:0 5px; overflow: hidden;">-->
    <div style="margin:0 5px;">
        <div style="" class="bi-stickUp clearfix">
            <div class="" role="group" style="float:right">
                <button type="button" onclick="exportData();" class="btn btn-default bi-btn-width90">到出</button>
                <button type="button" onclick="clearall();" class="btn btn-default bi-btn-width90">退出</button>
            </div>
        </div>
        <div id="dTitle" style="height: 30px; padding-top: 5px; text-align: center;">
            <label id="fTitle" style="font-size: 15pt; font-weight: bold;">考核评价</label>
        </div>
        <div class="div_border">
            <div class="div_h ">
                <label for="name" style="margin-right:12px;">姓名:</label>
                <input id="name" class="bi-width80 validate[required] form-control" type="text" placeholder=" "
                       name="name" />
            </div>
            <div class="div_h">
                <label for="zzjb">资质级别:</label>
                <input type="text" placeholder=" " id="zzjb" name="zzjb" class=" bi-width80 form-control"/>
            </div>
            <div class="div_h">
                <label for="zkf">总扣分:</label>
                <input type="text" placeholder=" " id="zkf" name="zkf" class=" bi-width80 form-control" />
            </div>
            <div class="div_h">
                <label for="zjf">总加分:</label>
                <input type="text" placeholder=" " id="zjf" name="zjf" class=" bi-width80 form-control" />
            </div>
        </div>

        <div style="width:100%;float:left;display:inline-block;">
            <table id="inputdivhand" class="datagrid"></table>
        </div>

        <div class="div_border">
            <div class="div_h ">
                <label for="zxylgzzd" style="margin-right:12px;width: 180px;">优质文明服务情况:</label>
                <input id="zxylgzzd" class="bi-width80 validate[required] form-control " style="width:430px;" type="text" placeholder=" "
                       name="zxylgzzd" />
            </div>
        </div>

        <div class="div_border">
            <div class="div_h ">
                <label for="yzwmfwqk" style="margin-right:12px;width: 180px;">遵循医疗规章制度和管理要求:</label>
                <input id="yzwmfwqk" class="bi-width80 validate[required] form-control" style="width:430px;"  type="text" placeholder=" "
                       name="yzwmfwqk" />
            </div>
        </div>

        <div class="div_border">
            <div class="div_h ">
                <label for="yyzfyq" style="margin-right:12px;width: 180px;">参加完成医院/政府任务情况:</label>
                <input id="yyzfyq" class="bi-width80 validate[required] form-control" style="width:430px;"  type="text" placeholder=" "
                       name="yyzfyq" />
            </div>
        </div>

        <div class="div_border">
            <div class="div_h ">
                <label for="khr" style="margin-right:12px;">考核人:</label>
                <input id="khr" class="bi-width80 validate[required] form-control" type="text" placeholder=" "
                       name="khr" />
            </div>
            <div class="div_h">
                <label for="khrq">考核日期:</label>
                <input type="text" placeholder=" " id="khrq" name="khrq" class=" bi-width140 form-control"
                       onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"/>
            </div>
            <div class="div_h">
                <label style="margin-right: 23px;margin-left: 30px;">是否通过:</label>
                <input type="radio" name="sftg" id="style-1" value="1"><label for="style-1" style="margin-right:33px;">通过</label>
                <input type="radio" name="sftg" id="style-2" value="2"> <label for="style-2" style="margin-right:33px;">不通过</label>
            </div>
        </div>
    </div>

</form>

</body>
</html>
